<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<%@ page import="com.scalar.chiptrack.utils.ConfigManager,java.util.ArrayList,com.scalar.chiptrack.sales.SalesOrder,com.scalar.chiptrack.sales.dao.SalesOrderDAO,
                 com.scalar.chiptrack.commons.Constants,
                 com.scalar.chiptrack.sales.forms.ApproverOrderForm,
				 com.scalar.chiptrack.commons.Address,
                 java.util.Calendar,
                 java.util.GregorianCalendar,
                 com.scalar.chiptrack.utils.StringUtils,
                 com.scalar.chiptrack.sales.Customer"%>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<%String customerId = request.getParameter("customerId"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script language="javaScript">

function sendMail(customerId)
{
	window.open ('<%=chipTracContext%>/sendPartNumbersMail.do?customerId=' + customerId , 'sendMailPopup1','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=550,resizable=yes');
}
</script>
<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet" >
<style type="text/css">
a { text-decoration : none}
</style>
</HEAD>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<!-- from here your body starts -->
<html:form name="customerPartNumbersForm" type="com.scalar.chiptrack.sales.forms.CustomerPartNumbersForm" action="/customerPartNumbers.do">


 <table width="90%" cellspacing='0' cellpadding='0' border=0 align=center>
    <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=15></td></tr>
    <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=15></td></tr>
    <tr>
        <td width="10%" valign="TOP"><img src="<%=chipTracContext%>/jsp/includes/images/scalar_logo.jpg" height="70" width='160' border=0/>&nbsp;&nbsp;</td>
        <td widht="25%" valign="TOP">
        <font size='3'><b><%=(String)request.getAttribute("clientName") %></b></font>
               <font class="NArialS"><%=(String)request.getAttribute("clientAddressAsAirgoFormatted")%></font><br>
        </td>
        <td width='20%' valign="TOP" nowrap><h4><bean:message key="label.customerPartNumber"/>s</h4></td>
        <%
            Calendar calendar = new GregorianCalendar();
            String date = ( ( calendar.get( Calendar.MONTH ) ) + 1 ) + "/" + calendar.get( Calendar.DATE )  + "/" + calendar.get( Calendar.YEAR );
        %>
        <td width='35%' class="NArialL" valign="TOP" align="center" nowrap><h4>Date: <%=StringUtils.formatDate( date ) %></h4>
        <table border=0>
        <tr><td>
        <font class="NArialW">
        <table align=center border='0' background='<%=chipTracContext%>/jsp/includes/images/printer_icon_small.gif'><tr><td>
        <a href="javascript:window.print();" title='Click here to Print'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td></tr></table>
        </font></td><td>
        <table align=left border ="0" background='<%=chipTracContext%>/jsp/includes/images/email1.gif'><tr><td>
        <a href="javascript:sendMail(<%=customerId%>);" title='Click here to Send Mail'>&nbsp;&nbsp;&nbsp;<br></a></td></tr></table>
        </td></tr></td></table>
   </tr>
   <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
   </table>

   <table border="0" width="90%" bordercolor='#000000' align="center" cellspacing='0' cellpadding='0'>
   <tr><td class="NArialL" colspan='4' align='center'><h5>Customer Name: <%=(String)request.getAttribute("customerName") %></h5></td></tr>
   </table>
   <table border="1" width="90%" bordercolor='#000000' align="center" cellspacing='0' cellpadding='0'>
   <tr><td colspan='4'>
           <table border="0" width='100%'>
           <tr>
            <td width='25%' class="NArialL" bgcolor="#DEE1E2">&nbsp;<bean:message key="label.mfgPartNumber" /></td>
            <td width='25%' class="NArialL" bgcolor="#DEE1E2"><bean:message key="label.customerPartNumber"/></td>
            <td width='25%' class="NArialL" bgcolor="#DEE1E2">ODM Name</td>
            <td width='25%' class="NArialL" bgcolor="#DEE1E2"><bean:message key="label.labelNumber" /></td>
            </tr>
            </table></td>
    </tr>
    <tr>
    <td colspan='4'>
    <table border="0" width='100%' cellspacing='0' cellpadding='2'>
        <% int bgcount = 0;%>
        <logic:iterate id="CustomerPartNumber" name="mfgPartsWithProductIdsWithOdmNames" type="com.scalar.chiptrack.sales.CustomerPartNumber">

            <%
            if( CustomerPartNumber.getManufacturingPartNo().equalsIgnoreCase("---- CHIPS -----") || CustomerPartNumber.getManufacturingPartNo().equalsIgnoreCase("---- BOARD -----") || CustomerPartNumber.getManufacturingPartNo().equalsIgnoreCase("---- KIT -----") ){
                bgcount = bgcount + 1;
                String mfgPart = "";
                if(CustomerPartNumber.getManufacturingPartNo().equalsIgnoreCase("---- CHIPS -----")) { mfgPart = "CHIPS";}
                else if (CustomerPartNumber.getManufacturingPartNo().equalsIgnoreCase("---- BOARD -----")){ mfgPart = "BOARD";}
                else { mfgPart = "KIT";}
            %>
            <tr>

            <td align=center colspan="4" <%if(bgcount%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL"><u><%=mfgPart%></u></font></td>
            </tr>
            <%}else if( (CustomerPartNumber.getCustomerPartNo()!= null && CustomerPartNumber.getCustomerPartNo().trim().length() > 0) || (CustomerPartNumber.getLabelNumber()!= null && CustomerPartNumber.getLabelNumber().trim().length() > 0) ){
                bgcount = bgcount + 1; %>
            <tr>
            <td width='25%' align=left  <%if(bgcount%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL">&nbsp;<bean:write name="CustomerPartNumber" property="manufacturingPartNo"/></font></td>
            <td width='25%' align=left  <%if(bgcount%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL"><bean:write name="CustomerPartNumber" property="customerPartNo" /></font></td>
            <td width='25%' align=left  <%if(bgcount%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL"><bean:write name="CustomerPartNumber" property="odmName"/></font></td>
            <td width='25%' align=left  <%if(bgcount%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>><font class="NArialL"><bean:write name="CustomerPartNumber" property="labelNumber"/></font></td>
            </tr>
            <%}%>


        </logic:iterate>
    </table></td></tr>

    </table>

</html:form>

</BODY>
</HTML>